package com.itheima;

import java.io.File;

public class DiGuiFile {
    public static void main(String[] args) {
        File srcFile = new File("D:\\下载\\file");
        getAllFilePath(srcFile);
    }

    private static void getAllFilePath(File srcFile) {
        File[] fileArray=srcFile.listFiles();
        if(fileArray!=null){
            for (File file : fileArray) {
                if(file.isDirectory()){
                    getAllFilePath(file);
                }else{
                    System.out.println(file+"目录下的子文件:");
                    System.out.println(file.getAbsolutePath());
                }
            }
        }
    }
}
